package com.community.controller;

import com.alibaba.nacos.common.model.core.IResultCode;
import com.community.domain.enity.UserVo;
import com.community.result.Result;
import com.community.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类名称： UserController
 * 描述：
 * 创建人：zyj
 * 创建时间：2023/11/7 14:13
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 登录
     * @param userVo
     * @return
     */
    @PostMapping("/loginByPassword")
    public Result<UserVo> userLoginByPassword(@RequestBody UserVo userVo){
        UserVo result = userService.userLoginByPassword(userVo);
        return Result.success(result);
    }

}
